package com.lepu.app.fun.my.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class BeanQuestionAnswer implements Serializable {

	private static final long serialVersionUID = 8296257066916405589L;
	
	public String ARQuestion;
	public String ARAnswer;

	public static ArrayList<BeanQuestionAnswer> parseJsonData(String dataString) {
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONArray dataArray = (JSONArray) obj1.get("ListInfo");
			
			result = dataArray.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}

		Gson gson = new Gson();
		ArrayList<BeanQuestionAnswer> testArraylist = gson.fromJson(result,
				new TypeToken<List<BeanQuestionAnswer>>() {
				}.getType());
		return testArraylist;
	}

}
